﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PlaxoSyncWM;

namespace TestPlaxoSyncWM {
    [TestClass]
    public class TestParseWebResponse {
        public String guidURL =
            "http://testapi.plaxo.com/rest?package=['Header',%20'ProtoVer',%20'1','Client',%20'Dev%20Clientname/1.0',%20'OS',%20'windows/service%20pack%20infinity',%20'Platform',%20'Outlook/2005']%0a['/Header']%0a['CreateGUID']%0a['/CreateGUID']";

        public string[] webResponseArray;
        public ParseWebResponse parser;
        private TestContext testContextInstance;
        private string guid;


        public TestContext TestContext {
            get { return testContextInstance; }
            set { testContextInstance = value; }
        }

        #region Additional test attributes

        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //

        #endregion

        [TestMethod]
        public void TestGetGuid() {
            parser = new ParseWebResponse();
            guid = parser.getGuid(guidURL);
            Assert.AreEqual(39, guid.Length);
        }
    }
}